<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
?>

<!-- JavaScript -->
<script type="text/javascript" src="<?= base_url() ?>js/wufoo.js"></script>
<!--<script src="<?= base_url() ?>js/chosen.jquery.js" type="text/javascript"></script>-->
<!-- CSS -->
<!--<link rel="stylesheet" type="text/css" href="<?= base_url() ?>css/form/form.css" media="screen, tv, projection" title="Default" />-->
<link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>css/datepicker.css" media="screen, tv, projection" title="Default" />
<script type="text/javascript" src="<?= base_url() ?>js/datepicker.js"></script>
<link rel="stylesheet" href="<?php echo base_url() ?>css/chosen.css" />
<style type="text/css">
table.stats{
	text-align: center;
	font-family: Verdana, Geneva, Arial, Helvetica, sans-serif ;
	font-weight: normal;
	font-size: 11px;
	color: #900000;
	width: 1000px;
	background-color: red;
	border: 0px;
	border-collapse: collapse;
	border-spacing: 0px;}

table.stats td{
	background-color: #900000;
	color: #fff;
	padding: 4px;
	/*text-align: center;*/
	border: 1px #FFABAB solid;
	font-weight: bold;}

table.stats td.hed{
	background-color: #E73737;
	color: #fff;
	padding: 4px;
	/*text-align: center;*/
	border-bottom: 2px #FFABAB solid;
	font-size: 12px;
	font-weight: bold;}

.header {
    border:outset 1px #ccc;
    background:#999;
    color:#000000;
    font-weight:bold;
    padding: 1px 2px;
    background:url(../../../images/formbg2.gif) left top;
    border-collapse    : collapse;
    font-size        : 12px;
}
.tab {
    font-family        : Verdana;
	font-size          : 12px;
	color              : #000000;
	background-color   : #FFFFFF;
	border            : groove 2px #666666;
	border-collapse    : collapse;
}
.fieldset2{
	border-color:#CC0000;
	height:250px;
}
</style>
<?php 
if($type == 'xls'){
	header("Content-type: application/vnd.ms-excel");
	header("Content-Disposition: attachment;Filename=$filename.xls");
}

?>
<div>
<?if($type=='html'){?>
<table border=0 cellspacing="5" width="950" style="font-size:12px;">
<tr>
	<td align="right" width="250"><img src="<?= base_url() ?>images/main/logo_sma.jpg" width="110" height="100" ></td>
	<td valign="bottom"><font size="6">SMA NEGERI 2 SIDOARJO</font><br><font size="3" valign="top"><i>Jl. Lingkar Barat Gading Fajar 2 Sidoarjo</i></font></td>
</tr>
</table><br>
<fieldset class="fieldset2">
	<legend class="legend">Laporan Hasil Belajar</legend>
<table style="font-size:12px;">
<tr><td><b>NIS : </b></td><td><b><?php echo $nisn?></b></td></tr>
<tr><td><b>Nama : </b></td><td><b><?php echo $nama?></b></td></tr>
<tr><td>Tingkat : </td><td><?php echo $r_tingkat?></td></tr>
<tr><td>Kelas : </td><td><?php echo $r_kelas?></td></tr>
<tr><td>Semester : </td><td><?php echo $r_semester?></td></tr>
<tr><td>Tahun Ajaran : </td><td><?php echo $tahunajaran?></td></tr>
</table><br>
<table class="stats" width="950">
	<tr>
		<td rowspan="2" class="header" height="25"  width="200" align="center">Pelajaran</td>
		<td colspan="3" class="header" height="15" align="center">Nilai</td>
		<!--<td rowspan="2" class="header" height="25" width="100" align="center">Predikat</td>-->
	</tr>
	<tr>
		<td class="header" height="10" width="100" align="center">Angka</td>
		<td class="header" height="10" width="100" align="center">Huruf</td>
		<td class="header" height="10" align="center">Terbilang</td>
	</tr>
	<?foreach($r_nilairaport->result() as $row){?>
		<tr>
			<td height="10" class="hed"><?php echo $row->NAMA_MATA_PELAJARAN;?></td>
			<td height="10" class="hed" align="center"><?php echo $row->NILAI;?></td>
			<td height="10" class="hed" align="center"><?php echo $row->NILAI_HURUF;?></td>
			<td height="10" class="hed" align="left"><?php echo spellNumC($row->NILAI);?></td>
			<!--<td height="10" class="hed">Baik</td>-->
		</tr>
	<?}?>
</table>
</fieldset>
<?}else{?>
<br><br>
<table border=0 cellspacing="5" width="950" style="font-size:12px;">
<tr>
	<td align="right" width="250"><img src="<?= base_url() ?>images/main/logo_sma.jpg" width="110" height="100" ></td>
	<td valign="bottom"><font size="6">SMA NEGERI 2 SIDOARJO</font><br><font size="3" valign="top"><i>Jl. Lingkar Barat Gading Fajar 2 Sidoarjo</i></font></td>
</tr>
</table><br>
<table style="font-size:12px;">
<tr><td colspan="2" style="text-align: center;"><font size="5"><b>Laporan Hasil Belajar</b></font></td></tr>
<tr><td><b>NIS : </b></td><td><b><?php echo $nisn?></b></td></tr>
<tr><td><b>Nama : </b></td><td><b><?php echo $nama?></b></td></tr>
<tr><td>Tingkat : </td><td><?php echo $r_tingkat?></td></tr>
<tr><td>Kelas : </td><td><?php echo $r_kelas?></td></tr>
<tr><td>Semester : </td><td><?php echo $r_semester?></td></tr>
<tr><td>Tahun Ajaran : </td><td><?php echo $tahunajaran?></td></tr>
</table><br>
<table border="1" style="border-collapse: collapse;" width="500">
	<tr>
		<td rowspan="2"  width="150" align="center">Pelajaran</td>
		<td colspan="3" width="380" align="center">Nilai</td>
		<!--<td rowspan="2" class="header" height="25" width="100" align="center">Predikat</td>-->
	</tr>
	<tr>
		<td width="20" nowrap align="center">Angka</td>
		<td width="20" nowrap align="center">Huruf</td>
		<td align="center">Terbilang</td>
	</tr>
	<?foreach($r_nilairaport->result() as $row){?>
		<tr>
			<td nowrap><?php echo $row->NAMA_MATA_PELAJARAN;?></td>
			<td width="20" nowrap align="center"><?php echo $row->NILAI;?></td>
			<td width="20" nowrap align="center"><?php echo $row->NILAI_HURUF;?></td>
			<td align="left" ><?php echo spellNumC($row->NILAI);?></td>
			<!--<td height="10" class="hed">Baik</td>-->
		</tr>
	<?}?>
</table><br><br><br>
<?}?>
</div>